package com.gray.blog.arg.sys;

import com.gray.blog.common.arg.BasePageArg;
import com.gray.blog.common.enums.sys.GetPageGameKeyWordTypeEnum;
import io.swagger.annotations.ApiModelProperty;
import java.util.Arrays;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;

/**
 * Created  By zhoux 2019/11/19
 **/
@Data
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
public class GetPageGameArg extends BasePageArg {

    @ApiModelProperty(value = "搜索关键词")
    private String keyWord;

    @ApiModelProperty(value = "搜索类型")
    private Integer keyWordType;

    public boolean isWrongParam() {
        return keyWordType != null && Arrays.stream(GetPageGameKeyWordTypeEnum.values()).noneMatch(data -> data.getType().equals(keyWordType));
    }

}
